package com.cgbl.cg.view

import android.content.Context
import android.widget.TextView
import com.cgbl.cg.R
import com.lxj.xpopup.core.BottomPopupView

class ReportPop(context: Context) : BottomPopupView(context) {
    private var confirmClickListener: (id: String) -> Unit = {}

    private var cancelClickListener: () -> Unit = {}

    private lateinit var tvConfirm: TextView
    private lateinit var tvCancel: TextView

    override fun getImplLayoutId(): Int {
        return R.layout.app_pop_report
    }

    override fun initPopupContent() {
        super.initPopupContent()
        tvCancel = findViewById(R.id.tv_cancel)
        tvConfirm = findViewById(R.id.tv_1)
        tvCancel.setOnClickListener {
            cancelClickListener.invoke()
        }

        tvConfirm.setOnClickListener {
            confirmClickListener.invoke("")
        }
    }

    fun setConfirmClickListener(click: (id: String) -> Unit): ReportPop {
        confirmClickListener = click
        return this
    }

    fun setCancelClickListener(click: () -> Unit): ReportPop {
        cancelClickListener = click
        return this
    }
}